﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CF_DAL_WS.Models;

namespace CF_DAL_WS.DTO
{
    public class FoodDetailDTO
    {
        public int ID { get; set; }
        public string Introduction { get; set; }

        public static FoodDetailDTO Translate(FoodDetail Entity)
        {
            if (Entity != null)
            {
                var dto = new FoodDetailDTO
                {
                    ID = Entity.ID,
                    Introduction = Entity.Introduction
                };
                return dto;
            }
            return null;
        }

        public static FoodDetail Reverse(FoodDetailDTO obj)
        {
            var entity = new FoodDetail
            {
                ID = obj.ID,
                Introduction = obj.Introduction
            };
            return entity;
        }

        public void UpdateEntity(ref FoodDetail entity)
        {
            entity.Introduction = Introduction;
        }
    }
}